package com.loser.excel.core;

import lombok.Data;

/**
 * 导出参数
 *
 * @author alan
 * @date 2022/6/10 12:05
 */
@Data
@SuppressWarnings("all")
public class ExcelExportParams<Params, ExportBean> {

    /**
     * 任务工单id(无须初始化)
     */
    private Long taskId;

    /**
     * 任务导出人(无须初始化)
     */
    private String exportUser;

    /**
     * 到导出数量(无须初始化)
     */
    private Long exportCount;

    /**
     * 自定义参数
     */
    private Params params;

    private Class<ExportBean> exportBeanClass;

    private CmsSearchExcelDataService exportServer;

    private ExcelExportParams(Params params, Class<ExportBean> exportBeanClass, CmsSearchExcelDataService exportServer, String exportUser) {
        this.params = params;
        this.exportBeanClass = exportBeanClass;
        this.exportServer = exportServer;
        this.exportUser = exportUser;
    }

    public ExcelExportParams() {
    }

    public static ExcelExportParams build(Object params, Class exportBeanClass, CmsSearchExcelDataService exportServer, String user) {
        return new ExcelExportParams(params, exportBeanClass, exportServer, user);
    }


}
